import service from "@/service";

//左侧树集合
export function getFileManageTreeList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/nodeList`,
    method: "GET",
    params,
  });
}
//左侧树-新增节点
export function getFileManageTreeSave(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/insertNode`,
    method: "POST",
    data,
  });
}
//左侧树-修改节点
export function getFileManageTreeUpdate(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/updateNode`,
    method: "POST",
    data,
  });
}
//左侧树-删除节点
export function getFileManageTreeDelete(nodeId) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/delNode?nodeId=${nodeId}`,
    method: "POST",
  });
}

//文档管理-新增
export function getFileListSave(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/insertDocument`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}
//文档管理-修改
export function getFileListUpdate(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/updateDocument`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}
//文档管理-删除
export function getFileListDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/delDocument/?documentId=${id}`,
    method: "POST",
  });
}
//文档管理-详情
export function getFileListDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/documentDetail/?documentId=${id}`,
    method: "GET",
  });
}
//文档管理-列表
export function getFileList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/documentList`,
    method: "GET",
    params,
  });
}
//导出
export function exportData(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdFileNode/exportZip`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params,
  });
}
